var obj = {
    name:"moyu",
    _age:21
}
Object.defineProperty(obj,"age",{
    configurable:true,
    enumerable:true,
    set:function(v){//在obj.age = 22
        console.log("生日到了，准备礼物....");
        this._age = v;
    },
    get:function(){
        return this._age;//在访问obj.age调用
    }
})
Object.defineProperty(obj,"weight",{
    configurable:true,//
    enumerable:false,  //不可枚举出来
    value:"60kg"//属性值
})
Object.defineProperty(obj,"gender",{
    configurable:true,
    writable:false,//不可写
    value:"女",
    enumerable:true
})
//尝试修改性别
obj.gender = "男";
console.log(obj);
console.log(obj.weight);
//每隔2秒自增一次
setInterval(function(){
    obj.age++
},2000)
